function checkusername() {
    var username = document.getElementById('username');
    if (username.value != 'admin') {
        alert("用户名输入错误");
        return false;
    } else {
        return true;
    }
}

function checkpassword() {
    var password = document.getElementById('password');
    if (password.value != '12345') {
        alert("密码输入错误");
        return false;
    } else {
        return true;
    }
}

function checkForm() {
    var flag = checkusername() && checkpassword();
    return flag;
}